{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fnil\fcharset77 Monaco;
}
{\colortbl;\red255\green255\blue255;\red0\green0\blue191;\red191\green0\blue0;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b\fs36 \cf0 FFTInterleave			 Combine two FFT chains\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f1\b0\fs24 \cf0 \

\f0\b 	chain = FFTInterleave(chain1, chain2)
\f1\b0 \
\
Takes two FFT "chain" signals and mixes them together. The FFT data is not actually combined in any sense: rather, the trigger signals which indicate that a new FFT buffer is ready for processing are combined. The first chain takes priority: if both chains fire at the same time, then the frame from the second will be ignored.\
\
Using this UGen only really makes sense when used in conjunction with [\ul FFTTriggered\ulnone ], since ordinary [\ul FFT\ulnone ] chains will typically always trigger at the same time.\
\
You might encounter problems further down the chain if the FFTs are not equally-sized.\
\
\

\f0\b Example
\f1\b0 \
\
This example uses the OnsetDetection UGen from Nick Collins' library. When an onset is detected, it triggers an FFT analysis using FFTTriggered. The use of FFTInterleave before analysing the FFT then gives the "best of both worlds" in that the continuous power analysis is extracted, but a more faithful measure of the power of the onsets is also included.\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f2\fs18 \cf0 s = \cf2 Server\cf0 .internal.boot;\
b = \cf2 Buffer\cf0 .alloc(s, 2048, 1);\
c = \cf2 Buffer\cf0 .alloc(s, 2048, 1);\
\
(\
x = \{\
\cf2 var\cf0  in, chain, normchain, trigchain, trigs, normpower, trigpower, mixedpower;\
in = \cf2 AudioIn\cf0 .ar([1,2]).mean;\
trigs = \cf2 OnsetDetection\cf0 .ar(in);\
\
normchain = \cf2 FFT\cf0 (b.bufnum, in);\
trigchain = \cf2 FFTTriggered\cf0 (c.bufnum, in, trigs);\
chain = \cf2 FFTInterleave\cf0 (trigchain, normchain); \cf3 // The trig chain should take priority\cf0 \
\
normpower = \cf2 FFTPower\cf0 .kr(normchain);\
trigpower = \cf2 FFTPower\cf0 .kr(trigchain);\
mixedpower = \cf2 FFTPower\cf0 .kr(chain);\
[trigpower, normpower, mixedpower]\
\}\
)\
\
\cf3 // Interactive\cf0 \
x.scope;\
\
\cf3 // 5 seconds' worth, plotted. Make noises for 5 seconds.\cf0 \
x.plot(5, s);}